package com.imooc.poker_game;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 一副牌
 * <p>
 * 2 3 4 5 6 7 8 9 10
 * J Q K A
 */
public class Poker {
    /**
     * 装 52 张牌的
     */
    public List<PokerPiece> pokerPieces = new ArrayList<PokerPiece>();

    /**
     * 花色
     */
    public int[] patterns = new int[]{1, 2, 3, 4};

    /**
     * 牌面
     */
    public int[] figures = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};

    public Poker() {
        for (int pattern : patterns) {
            for (int figure : figures) {
                pokerPieces.add(new PokerPiece(pattern, figure));
            }
        }
    }

    /**
     * 洗牌
     */
    public void shuffle() {
        Collections.shuffle(pokerPieces);
    }

    public void show() {
        for (PokerPiece pkerPiece:pokerPieces) {
            System.out.println(pkerPiece.show() + ",");
        }
    }
}
